home *** CD-ROM | disk | FTP | other *** search
- $STRING 1
- $INCLUDE "GEMDOS.INC"
- $INCLUDE "JANUS.INC"
-
- %A6Low = %A6+1
- dim sektoren(5),tracks(5),heads(5),fat(5),sekProCluster(5),file(5)
-
- if command$=GemDOS$ then
- call PrepareScreen(20,"Disketten installieren")
- else
- call InitScreen(20,"Disketten installieren")
- end if
-
- test=CheckInt(29)
- if test=0 then
- color 12
- call Center(9,"Der Amiga-Treiber Disk Transfer wurde nicht gestartet!")
- call Center(11,"Starten Sie Disk Transfer und versuchen Sie erneut,")
- call Center(12,"dieses Programm aufzurufen!")
- call BoolGadget(5,26,25,1,"Zurck zu AControl",1)
-
- call MouseOn
- ende=0
- while ende=0
- call MouseDown
- if mouse.button<>0 then call MouseHandler
- if gad.num=1 or gad.num=33333 then
- ende=1
- end if
- gad.num=-1
- wend
- call MouseOff
- end
- end if
-
- Feld2$(0)="Formatierung starten"
- Feld2$(1)="Voreinstellungen sichern"
- Feld2$(2)="-"
- Feld2$(3)="Information"
- Feld2$(4)="-"
- Feld2$(5)="Zurck zu AControl"
-
- call BoolGadget(5,26,25,1,"Zurck zu AControl",1)
- call BoolGadget(5,19,15,1,"Formatieren",100)
- 19 error 0
- 20 open "install.dat" for input as #1
- if erl<>20 then
- a=asc(input$(1,1))
- b=asc(input$(1,1))
- close #1
- else
- b=1
- a=0
- end if
- call ToggleGadget(5,21,15,1,"Quick",b,150)
- call ToggleGadget(5,23,15,1,"Verify",a,200)
- call DrawPBorder(23,19,52,5,"")
- call MenuGadget(6,"Datei",10000)
- call MenuGadget(20,"Laufwerk",10001)
- call ZeigeLaufwerke
- locate 20,25
- print "Aktuelle Spur: 0"
- locate 21,25
- print "Kommentar: -"
- locate 23,26
- print "0 %"
- call DrawPBorder(30,22,43,1,"")
- call MouseOn
-
- ende=0
- while ende=0
- call MouseDown
- if mouse.button<>0 then call MouseHandler
-
- if gad.num<>-1 then
- if gad.num=1 or gad.num=33333 then
- ende=1
- elseif gad.num=10000 then
- call MenuHandler(6,250,Feld2$(),6)
- select case menu.num
- case 0
- call DiskFormatieren
- case 1
- 9 error 0
- 10 open "install.dat" for output as #1
- if erl<>10 then
- print #1,chr$(gad.selected(4));chr$(gad.selected(3));
- close #1
- else
- call Bell
- end if
- case 3
- call InformationBox("Disketten-Installation - Version 1.0","Copyright (C) 1994 by","Thomas Dreibholz","All rights reserved.")
- case 5
- ende=1
- end select
- elseif gad.num=10001 then
- call MenuHandler(20,250,Feld1$(),6)
- if menu.num<>-1 then
- call MouseOff
- call DrawPBorder(5,6+drive*2,70,1,"")
- call DrawNBorder(5,6+menu.num*2,70,1,"")
- call MouseOn
- drive=menu.num
- end if
- elseif gad.num=100 then
- call DiskFormatieren
- elseif gad.num>=10 and gad.num<=16 then
- x=gad.num-10
- call MouseOff
- call DrawPBorder(5,6+drive*2,70,1,"")
- call DrawNBorder(5,6+x*2,70,1,"")
- call MouseOn
- drive=x
- end if
- end if
-
- gad.num=-1
- wend
-
- call MouseOff
- end
-
- sub ZeigeLaufwerke shared
- x=0
- def seg = jint.segment
- for i=0 to 5
- call SelectDrive(i)
- pokei jint.offset+%A1,5
- call CallAndWait
- if peeki(jint.offset+%A2)<>1000 then
-
- sektoren(i)=peeki(jint.offset+%A2)
- tracks(i)=peeki(jint.offset+%A3)
- heads(i)=peeki(jint.offset+%A4)
- fat(i)=peeki(jint.offset+%A5)
- sekProCluster(i)=peek(jint.offset+%A6Low)
- file(i)=peeki(jint.offset+%A7)
-
- call MinGadget(5,6+i*2,70,1,10+i)
- Feld1$(i)="Virtuelles Laufwerk"+str$(i+1)
- if x=0 then
- call DrawNBorder(5,6+i*2,70,1,"Virtuelles Laufwerk"+str$(i+1))
- drive=i
- x=1
- else
- call DrawPBorder(5,6+i*2,70,1,"Virtuelles Laufwerk"+str$(i+1))
- end if
- else
- Feld1$(i)="Virtuelles Laufwerk"+str$(i+1)+chr$(0)
- call DrawPBorder(5,6+i*2,70,1,"Virtuelles Laufwerk"+str$(i+1)+" wurde noch nicht definiert")
- end if
- next
- end sub
-
- sub DiskFormatieren shared
- dim okay(tracks(drive))
-
- if tracks(drive)=0 then exit sub
- call MouseOff
- def seg = jint.segment
- call SelectDrive(drive)
- locate 21,40
- print "Formatiere virtuelles Laufwerk";drive+1
- line (239,349)-(581,367),0,bf
- if gad.selected(3)=1 and file(drive)<>3 then
- for i=0 to tracks(drive)-1
- locate 20,39
- print i;string$(8," ")
- call FormatiereSpur(i)
-
- x=PEEKI(jint.offset+%A2)
- if x<>0 then
- if x=1 then t$="Nicht genug Amiga-Speicher!"
- if x=2 then t$="Fehler beim Formatieren!"
- if x=3 then t$="Fehlerhafte Spur ausgeklammert."
- locate 21,40
- print t$;string$(34-len(t$)," ")
- if x=1 or x=2 then goto Fertig
- okay(i)=1
- else
- okay(i)=0
- end if
-
- ps=int((100*i)/(tracks(drive)-1))
- locate 23,24
- x$=str$(ps)+" %"
- x$=x$+string$(6-len(x$)," ")
- print x$
- w=(342*ps)/100
- line (239,349)-(239+w,367),14,bf
- next
- else
- locate 20,39
- print tracks(drive)-1;string$(8," ")
- locate 23,25
- print "100 %"
- for i=0 to tracks(drive)-1
- okay(i)=0
- next
- end if
- call InstalliereFAT(okay())
- if fatOkay=1 then
- t$="Formatierung erfolgreich beendet!"
- locate 21,40
- print t$;string$(34-len(t$)," ")
- end if
- Fertig:
- call MouseOn
- erase okay
- end sub
-
- sub FormatiereSpur(spur) shared
- if gad.selected(4)=1 then x=0 else x=1
- call Format(spur,x)
- end sub
-
- sub InstalliereFAT(okay()) shared
- fatOkay=0
-
- fSektoren=sektoren(drive)
- fHeads=heads(drive)
- fTracks=tracks(drive)
- fSekProCluster=sekProCluster(drive)
- fFATSektoren=fat(drive)
-
- t$="FAT wird erstellt."
- locate 21,40
- print t$;string$(34-len(t$)," ")
-
- rem Boot-Sektor schreiben
- poke jint.offset+&H00,0
- poke jint.offset+&H01,0
- poke jint.offset+&H02,0
- i$="-TD- 2.0"
- for i=0 TO 7
- poke jint.offset+&H03+i,asc(mid$(i$,i+1,1))
- next
- pokei jint.offset+&H0B,512
- poke jint.offset+&H0D,fSekProCluster
- pokei jint.offset+&H0E,1
- poke jint.offset+&H10,1
- pokei jint.offset+&H11,112
- pokei jint.offset+&H13,fSektoren
- poke jint.offset+&H15,&HF8
- pokei jint.offset+&H16,fFATSektoren
- pokei jint.offset+&H18,fSektoren/fTracks/fHeads
- pokei jint.offset+&H1A,fHeads
- pokei jint.offset+&H1C,1
- for i=&H1E TO &HFF
- poke jint.offset+i,0
- next
- call XWrite(0,1)
- if peeki(jint.offset+%A2)<>0 then
- call SFehler
- exit sub
- end if
-
- rem File Allocation Table schreiben
- for i=0 to fFATSektoren*512
- poke jint.offset+i,0
- next
-
- if fSektoren>4096 then fat12=0 else fat12=1
-
- if fat12=1 then
- poke jint.offset+0,&HFB
- poke jint.offset+1,&HFF
- poke jint.offset+2,&HFF
- rem $F7 $7F $FF
- for i=0 to fTracks-1
- if okay(i)=1 then
- for z=0 to (fSektoren/fTracks/fHeads)
- sektor=i*(fSektoren/fTracks)+z
- cluster=sektor/fSekProCluster
- if (cluster mod 1)<>0 or (sektor mod 1)<>0 then
- ?cluster,sektor
- ?"ERROR"
- end
- end if
- if (cluster mod 2)=0 then
- position=3+cluster*1.5
- poke jint.offset+position,&HF7
- poke jint.offset+position+1,&HF
- else
- position=4+(cluster-1)*1.5
- old=peek(jint.offset+position)
- old=old+&H70
- poke jint.offset+position,old
- poke jint.offset+position+1,&HFF
- end if
- next
- end if
- next
- else
- pokei jint.offset+0,&HFFFB
- end if
- call XWrite(1,fFATSektoren)
- if peeki(jint.offset+%A2)<>0 then
- call SFehler
- exit sub
- end if
-
- rem Hauptverzeichnis
- for i=0 to 2048
- poke jint.offset+i,0
- next
- n$="EMPTY DISK "+CHR$(8)+CHR$(0)
- for i=0 to 12
- poke jint.offset+i,asc(mid$(n$,i+1,1))
- next
- call XWrite(fFATSektoren+1,4)
- if peeki(jint.offset+%A2)<>0 then
- call SFehler
- exit sub
- end if
- call Update
- if peeki(jint.offset+%A2)<>0 then
- call SFehler
- exit sub
- end if
-
- fatOkay=1
- end sub
-
- sub SFehler static
- t$="Fehler beim Schreiben!"
- locate 21,40
- print t$;string$(34-len(t$)," ")
- end sub
-
- sub XWrite(sektor,length) shared
- pokei jint.offset+%A1,1
- pokei jint.offset+%A2,length
- pokei jint.offset+%A3,sektor
- call CallAndWait
- end sub
-
- sub Format(spur,xverify) shared
- pokei jint.offset+%A1,10
- pokei jint.offset+%A2,spur
- pokei jint.offset+%A3,xverify
- call CallAndWait
- end sub
-
- sub Update shared
- pokei jint.offset+%A1,3
- call CallAndWait
- end sub
-
- sub SelectDrive(num) shared
- pokei jint.offset+%A1,100
- pokei jint.offset+%A2,num
- call CallAndWait
- end sub